ActiveRecord::Schema.define() do
    
    create_table "People", :force => true do |t|
        t.column :first_name, :string, :limit => 80
        t.column :middle_name, :string, :limit => 80
        t.column :last_name, :string, :limit => 80
        t.column :created_at, :timestamp
        t.column :updated_at, :timestamp
        t.column :voter, :boolean
        t.column :birth_date, :timestamp
    end    
    
    create_table "phone_numbers", :force => true do |t|
        t.column :number, :string, :limit => 20
    end
    
    create_table "addresses", :force => true do |t|
        t.column :street1, :string, :limit => 80
        t.column :street2, :string, :limit => 80
        t.column :street3, :string, :limit => 80
        t.column :city, :string, :limit => 80
        t.column :state_id, :integer
    end

	create_table "person_phone_number", :force => true do |t|
		t.column :person_id, :integer
		t.column :phone_id, :integer
        t.column :daytime, :boolean
        t.column :sms, :boolean
        t.column :preferred, :boolean
	end

	create_table "person_address", :force => true do |t|
		t.column :person_id, :integer
		t.column :address_id, :integer
		t.column :primary_residence, :boolean
		t.column :work_address, :boolean
	end

    create_table "districts", :force => true do |t|
		# label is a description of the geographical zone
		# Example "School Board District 93"
		# For US Senate and state-wide races, state and geocode is necessary
		t.column :label, :string, :limit => 80
        t.column :number, :string, :limit => 10 # Numerical String
        t.column :county, :string, :limit => 80
        t.column :city, :string, :limit => 80
        t.column :state_id, :integer, :limit => 2
		# Geocode XML Files
		t.column :kml, :text # Google's format
		t.column :gml, :text
    end
    
    create_table "states", :force => true do |t|
        t.column :postal_abbreviation, :string, :limit => 2
        t.column :name, :string, :limit => 80
    end
    
	create_table "teams", :force => true do |t|
		t.column :label, :string, :limit => 20
		t.column :created_at, :timestamp
		t.column :updated_at, :timestamp
	end
	
	create_table "roles", :force => true do |t|
		t.column :label, :string, :limit => 20
	end

	create_table "team_role_person", :force => true do |t|
		t.column :team_id, :integer
		t.column :role_id, :integer
		t.column :person_id, :integer
    end
    
	create_table "campaigns", :force => true do |t|
		# Suggested Labels include Candidate/Race, Prop number, Cause
		t.column :label, :string, :limit => 80
		# Text can be the full description, text format legislation
		# or other legal description
		t.column :description, :text
		t.column :created_at, :timestamp
		t.column :updated_at, :timestamp
	end

	create_table "team_campaign", :force => true do |t|
		t.column :team_id, :integer
		t.column :campaign_id, :integer
	end

	create_table "events", :force => true do |t|
		t.column :label, :string, :limit => 80
		t.column :location, :integer
		t.column :kml, :text
		t.column :start_time, :timestamp
		t.column :end_time, :timestamp
		t.column :team_id, :integer
		t.column :created_at, :timestamp
		t.column :updated_at, :timestamp
	end
	
end
